home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d27
/
modjobd.arc
/
MODJOBD.ASM
< prev
next >
Wrap
Assembly Source File
|
1991-12-04
|
16KB
|
452 lines
/********************************************************************/
/* */
/* (C) Copyright 1986 Mike Hoyes */
/* */
/* Title : MODJOBDA */
/* Author : Mike Hoyes */
/* Date Written: January 1986 */
/* */
/* Modify Job Description */
/* */
/********************************************************************/
TITLE 'MODIFY JOB DESCRIPTION INFORMATION';
SPACE;
/* PARAMETERS PASSED TO PROGRAM */
SPACE;
DCL SPCPTR P.JOBD PARM;
DCL OL PLIST(P.JOBD) PARM EXT;
DCL DD PASS CHAR(20) BAS(P.JOBD);
DCL DD JOBD CHAR(10);
DCL DD LIB CHAR(10);
SPACE 2;
/* OPERAND FOR RSLVSP FOR JOBD NAME */
SPACE;
DCL DD OBJ CHAR(34);
DCL DD OTYPE CHAR(2) DEF(OBJ) INIT(X'1903');
DCL DD ONAME CHAR(30) DEF(OBJ) POS(3) INIT;
DCL DD OATHR CHAR(2) DEF(OBJ) POS(33) INIT(X'0000');
SPACE 2;
/* OPERAND FOR RSLVSP FOR LIBRARY NAME */
SPACE;
DCL DD CNTX CHAR(34);
DCL DD CTYPE CHAR(2) DEF(CNTX) INIT(X'0401');
DCL DD CNAME CHAR(30) DEF(CNTX) POS(3) INIT;
DCL DD CATHR CHAR(2) DEF(CNTX) POS(33) INIT(X'0800');
SPACE 2;
/* BASE COMMUNICATIONS OBJECT */
SPACE;
DCL SPC WCB BASPCO;
DCL PTR SEPT@ DEF(WCB) POS(1);
DCL PTR SEPT(1050) BAS(SEPT@);
DCL SYSPTR QTEMP DEF(WCB) POS(65);
SPACE 2;
/* POINTERS AND VARIABLES IN JOBD SPACE */
SPACE;
DCL SYSPTR CTX;
DCL SYSPTR SPACE;
DCL SPCPTR PSPACE;
DCL DD AREA CHAR(864) BAS(PSPACE);
DCL DD USRPRF CHAR(10) BAS(PSPACE) POS(3);
DCL DD JOBQ1 CHAR(10) BAS(PSPACE) POS(13);
DCL DD JOBQ2 CHAR(10) BAS(PSPACE) POS(23);
DCL DD JOBQPR CHAR(1) BAS(PSPACE) POS(33);
DCL DD OUTQPR CHAR(1) BAS(PSPACE) POS(34);
DCL DD RTGDTA CHAR(80) BAS(PSPACE) POS(35);
DCL DD SYNTAX BIN(2) BAS(PSPACE) POS(119);
DCL DD CNLSEV BIN(2) BAS(PSPACE) POS(121);
DCL DD LOGLVL CHAR(1) BAS(PSPACE) POS(123);
DCL DD MSGSEV BIN(2) BAS(PSPACE) POS(124);
DCL DD MSGTXT CHAR(1) BAS(PSPACE) POS(126);
DCL DD OUTQ1 CHAR(10) BAS(PSPACE) POS(127);
DCL DD OUTQ2 CHAR(10) BAS(PSPACE) POS(137);
DCL DD HOLD CHAR(1) BAS(PSPACE) POS(147);
DCL DD JOBDAT CHAR(7) BAS(PSPACE) POS(148);
DCL DD JOBSWS CHAR(8) BAS(PSPACE) POS(155);
DCL DD INQMSG CHAR(1) BAS(PSPACE) POS(163);
DCL DD ACGCD CHAR(15) BAS(PSPACE) POS(164);
DCL DD CNT BIN(2) BAS(PSPACE) POS(307);
DCL DD LIBS(25) CHAR(10) BAS(PSPACE) POS(309);
DCL DD RQSDTA CHAR(255) BAS(PSPACE) POS(609);
SPACE 2;
/* PROGRAM VARIABLES */
SPACE;
DCL DD CMD CHAR(768) INIT('CHGJOBD ?*JOBD(');
DCL DD I BIN(4);
DCL DD J BIN(4);
DCL DD K BIN(4);
DCL DD CMDLEN PKD(15,5);
DCL DD LINE CHAR(15);
DCL DD BIN4 CHAR(7) INIT(X'02000F00000000');
DCL DD BINLEN CHAR(1) DEF(BIN4) POS(3);
DCL DD *IN01 CHAR(1) INIT('0');
SPACE 2;
/* PARAMETERS FOR QCAEXEC CALL */
SPACE;
DCL SPCPTR P.CMD INIT(CMD);
DCL SPCPTR P.CMDLEN INIT(CMDLEN);
DCL OL EXECLST(P.CMD,P.CMDLEN) ARG;
SPACE 2;
/* PARAMETERS FOR QMHSNPGM CALL */
SPACE;
DCL DD MSG CHAR(255);
DCL DD * BIN(2) DEF(MSG) POS(1) INIT(1);
DCL DD * CHAR(253) DEF(MSG) POS(3) INIT;
DCL DD MSGID CHAR(7) INIT('CPF9898');
DCL DD MSGF CHAR(20) INIT('QCPFMSG QSYS');
DCL DD MSGDTA CHAR(255);
DCL DD * CHAR(1) DEF(MSGDTA) POS(1) INIT('E');
DCL DD DTALEN BIN(2) DEF(MSGDTA) POS(2) INIT(27);
DCL DD V1 CHAR(252) DEF(MSGDTA) POS(4) INIT;
DCL DD PGMQ CHAR(18) INIT(X'000202D7D9C5E5075C40');
DCL DD MSGQ CHAR(22) INIT(X'00015CE3D6D7C7D4D8');
DCL DD MSGTYP CHAR(6) INIT('ESCP ');
DCL SPCPTR P.1 INIT(MSG);
DCL SPCPTR P.2 INIT(MSGID);
DCL SPCPTR P.3 INIT(MSGF);
DCL SPCPTR P.4 INIT(MSGDTA);
DCL SPCPTR P.5 INIT(PGMQ);
DCL SPCPTR P.6 INIT(MSGQ);
DCL SPCPTR P.7 INIT(MSGTYP);
DCL SPCPTR P.8;
DCL SPCPTR P.9;
DCL OL MSGLST(P.1,P.2,P.3,P.4,P.5,P.6,P.7,P.8,P.9) ARG;
SPACE 2;
/* PARAMETERS FOR INTERNAL CALL */
SPACE;
DCL DD LEN BIN(4);
DCL SPCPTR STRING;
DCL SPCPTR LENGTH INIT(LEN);
DCL OL MLIST(STRING,LENGTH);
DCL INSPTR RTNPTR;
SPACE 2;
/* EXCEPTION MONITORS */
SPACE;
DCL EXCM * IMD BP(.CNL) CV('CPF') EXCID(H'6801');
DCL EXCM E1 IMD BP(.ERR) CV('CPF') EXCID(H'0000');
SPACE 3;
ENTRY *(PLIST) EXT;
CPYBLA JOBD,PASS(1:10);
CPYBLA LIB,PASS(11:10);
CPYNV J,16;
CPYBLA ONAME,JOBD;
SPACE;
/* Check for library name */
CMPBLA(B) LIB,'*LIBL'/EQ(.NOLIB);
CMPBLA(B) LIB,'QTEMP '/EQ(.TEMP) /*QTEMP cannot be resolved
by name*/;
BRK 'RSLVLIB';
CPYBLA CNAME,LIB;
RSLVSP CTX,CNTX,*,*;
B .SKP;
SPACE;
/* Set context pointer to QTEMP if selected */
.TEMP: CPYBWP CTX,QTEMP;
SPACE;
/* Resolve system pointer for Job Description in library specified */
.SKP: RSLVSP SPACE,OBJ,CTX,*;
B .CONT;
BRK 'RSLVOBJ';
SPACE;
/* Resolve system pointer for job Description in *LIBL */
.NOLIB: RSLVSP SPACE,OBJ,*,*;
SPACE;
/* Set space pointer to Job Description space */
.CONT: SETSPPFP PSPACE,SPACE;
BRK 'JOBD';
SPACE;
/* Add job description name to command string */
SETSPP STRING,JOBD;
CPYNV LEN,10;
CALLI MOVSTR,MLIST,RTNPTR;
CPYBLA CMD(J:1),'.';
ADDN(S) J,1;
SETSPP STRING,LIB;
CPYNV LEN,10;
CALLI MOVSTR,MLIST,RTNPTR;
CPYBLA CMD(J:9),') ??USER(';
ADDN(S) J,9;
BRK 'USER';
SPACE;
/* Add user profile to command string */
SETSPP STRING,USRPRF;
CPYNV LEN,10;
CALLI MOVSTR,MLIST,RTNPTR;
CPYBLA CMD(J:9),') ??JOBQ(';
ADDN(S) J,9;
BRK 'JOBQ';
SPACE;
/* Add Job queue to command string */
SETSPP STRING,JOBQ1;
CPYNV LEN,10;
CALLI MOVSTR,MLIST,RTNPTR;
CPYBLA CMD(J:1),'.';
ADDN(S) J,1;
SETSPP STRING,JOBQ2;
CPYNV LEN,10;
CALLI MOVSTR,MLIST,RTNPTR;
CPYBLA CMD(J:11),') ??JOBPTY(';
ADDN(S) J,11;
BRK 'JOBPTY';
SPACE;
/* Add Job queue priority to command string */
CPYBLA CMD(J:1),JOBQPR;
ADDN(S) J,1;
CPYBLA CMD(J:11),') ??OUTPTY(';
ADDN(S) J,11;
BRK 'OUTPTY';
SPACE;
/* Add Out queue priority to command string */
CPYBLA CMD(J:1),OUTQPR;
ADDN(S) J,1;
CPYBLA CMD(J:11),') ??ACGCDE(';
ADDN(S) J,11;
BRK 'ACGCDE';
SPACE;
/* Add Accounting code to command string */
CMPBLA(B) ACGCD,' '/EQ(.NOACG);
CPYBLA CMD(J:1),X'7D';
ADDN(S) J,1;
SETSPP STRING,ACGCD;
CPYNV LEN,15;
CALLI TRCSTR,MLIST,RTNPTR;
CPYBLA CMD(J:1),X'7D';
ADDN(S) J,1;
B .ACGCNT;
.NOACG: CPYBLA CMD(J:6),'*BLANK';
ADDN(S) J,6;
.ACGCNT: CPYBLA CMD(J:11),') ??RTGDTA(';
ADDN(S) J,11;
BRK 'RTGDTA';
SPACE;
/* Add Routing data to command string */
CMPBLA(B) RTGDTA,'*GET'/EQ(.SK1);
CMPBLA(B) RTGDTA,'*RQSDTA'/EQ(.SK1);
CPYBLA CMD(J:1),X'7D';
ADDN(S) J,1;
.SK1: SETSPP STRING,RTGDTA;
CPYNV LEN,80;
CALLI TRCSTR,MLIST,RTNPTR;
CMPBLA(B) RTGDTA,'*GET'/EQ(.SK2);
CMPBLA(B) RTGDTA,'*RQSDTA'/EQ(.SK2);
CPYBLA CMD(J:1),X'7D';
ADDN(S) J,1;
.SK2: CPYBLA CMD(J:11),') ??RQSDTA(';
ADDN(S) J,11;
BRK 'RQSDTA';
SPACE;
/* Add Request data to command string */
CMPBLA(B) RQSDTA,'*NONE'/EQ(.SK3);
CMPBLA(B) RQSDTA,'*RTGDTA'/EQ(.SK3);
CPYBLA CMD(J:1),X'7D';
ADDN(S) J,1;
.SK3: SETSPP STRING,RQSDTA;
CPYNV LEN,255;
CALLI TRCSTR,MLIST,RTNPTR;
CMPBLA(B) RQSDTA,'*NONE'/EQ(.SK4);
CMPBLA(B) RQSDTA,'*RTGDTA'/EQ(.SK4);
CPYBLA CMD(J:1),X'7D';
ADDN(S) J,1;
.SK4: CPYBLA CMD(J:11),') ??SYNTAX(';
ADDN(S) J,11;
BRK 'SYNTAX';
SPACE;
/* Add Syntax severity to command string */
CMPNV(B) SYNTAX,-1/EQ(.NOSYN);
CPYBLA BINLEN,X'02';
CVTNC LINE,SYNTAX,BIN4;
CPYBLA CMD(J:2),LINE(1:2);
ADDN(S) J,2;
B .SYNCNT;
.NOSYN: CPYBLA CMD(J:6),'*NOCHK';
ADDN(S) J,6;
.SYNCNT: CPYBLA CMD(J:12),') ??INLLIBL(';
ADDN(S) J,12;
BRK 'INLLIBL';
SPACE;
/* Add Initial Library list to command string */
CMPNV(B) CNT,-1/EQ(.SYSLIB);
CMPNV(B) CNT,0/EQ(.NOTLIB);
CPYNV K,1;
.LIBLP: SETSPP STRING,LIBS(K);
CPYNV LEN,10;
CALLI MOVSTR,MLIST,RTNPTR;
ADDN(S) J,1;
ADDN(S) K,1;
CMPNV(B) K,CNT/NHI(.LIBLP);
B .LIBCNT;
.NOTLIB: CPYBLA CMD(J:5),'*NONE';
ADDN(S) J,5;
B .LIBCNT;
.SYSLIB: CPYBLA CMD(J:7),'*SYSVAL';
ADDN(S) J,7;
.LIBCNT: CPYBLA CMD(J:11),') ??CNLSEV(';
ADDN(S) J,11;
BRK 'CNLSEV';
SPACE;
/* Add Cancel severity to command string */
CPYBLA BINLEN,X'02';
CVTNC LINE,CNLSEV,BIN4;
CPYBLA CMD(J:2),LINE(1:2);
ADDN(S) J,2;
CPYBLA CMD(J:8),') ??LOG(';
ADDN(S) J,8;
BRK 'LOG';
SPACE;
/* Add Log levels to command string */
CPYBLA CMD(J:1),LOGLVL;
ADDN(S) J,2;
CPYBLA BINLEN,X'02';
CVTNC LINE,MSGSEV,BIN4;
CPYBLA CMD(J:2),LINE(1:2);
ADDN(S) J,3;
CMPBLA(B) MSGTXT,'M'/NEQ(.NXT1);
CPYBLA CMD(J:4),'*MSG';
ADDN(S) J,4;
.NXT1: CMPBLA(B) MSGTXT,'S'/NEQ(.NXT2);
CPYBLA CMD(J:7),'*SECLVL';
ADDN(S) J,7;
.NXT2: CMPBLA(B) MSGTXT,'N'/NEQ(.NXT3);
CPYBLA CMD(J:7),'*NOLIST';
ADDN(S) J,7;
.NXT3: CPYBLA CMD(J:14),') ??INQMSGRPY(';
ADDN(S) J,14;
BRK 'INQMSGRPY';
SPACE;
/* Add Inquire Message Reply to command string */
CMPBLA(B) INQMSG,X'00'/NEQ(.INQ1);
CPYBLA CMD(J:4),'*RQD';
ADDN(S) J,4;
.INQ1: CMPBLA(B) INQMSG,X'01'/NEQ(.INQ2);
CPYBLA CMD(J:4),'*DFT';
ADDN(S) J,4;
.INQ2: CMPBLA(B) INQMSG,X'02'/NEQ(.INQ3);
CPYBLA CMD(J:8),'*SYSRPYL';
ADDN(S) J,8;
.INQ3: CPYBLA CMD(J:9),') ??OUTQ(';
ADDN(S) J,9;
BRK 'OUTQ';
SPACE;
/* Add Out Queue to command string */
SETSPP STRING,OUTQ1;
CPYNV LEN,10;
CALLI MOVSTR,MLIST,RTNPTR;
CPYBLA CMD(J:1),'.';
ADDN(S) J,1;
SETSPP STRING,OUTQ2;
CPYNV LEN,10;
CALLI MOVSTR,MLIST,RTNPTR;
CPYBLA CMD(J:9),') ??HOLD(';
ADDN(S) J,9;
BRK 'HOLD';
SPACE;
/* Add Hold option to command string */
CMPBLA(B) HOLD,'N'/NEQ(.NXT4);
CPYBLA CMD(J:3),'*NO';
ADDN(S) J,3;
.NXT4: CMPBLA(B) HOLD,'Y'/NEQ(.NXT5);
CPYBLA CMD(J:4),'*YES';
ADDN(S) J,4;
.NXT5: CPYBLA CMD(J:9),') ??DATE(';
ADDN(S) J,9;
BRK 'DATE';
SPACE;
/* Add Job Date to command string */
CMPBLA(B) JOBDAT,'0010000'/EQ(.NXT6);
CPYBLA CMD(J:4),JOBDAT(4:4);
ADDN(S) J,4;
CPYBLA CMD(J:2),JOBDAT(2:2);
ADDN(S) J,2;
B .NXT7;
.NXT6: CPYBLA CMD(J:7),'*SYSVAL';
ADDN(S) J,7;
.NXT7: CPYBLA CMD(J:8),') ??SWS(';
ADDN(S) J,8;
BRK 'SWS';
SPACE;
/* Add Job switchs to command string */
CPYBLA CMD(J:8),JOBSWS;
ADDN(S) J,8;
CPYBLA CMD(J:10),') ??TEXT()';
ADDN(S) J,10;
BRK 'EXEC';
SPACE;
/* Execute the command string */
CPYNV CMDLEN,J;
CALLX SEPT(276),EXECLST,*;
B .OK;
SPACE;
/* Branch point if CF1 pressed in QCAEXEC */
.CNL: MODEXCPD E1,X'2000',X'01';
CPYBLA MSGID,'CPF6801';
CPYNV DTALEN,1;
CALLX SEPT(899),MSGLST,*;
B .END;
SPACE;
/* Branch point for any errors that occur */
.ERR: MODEXCPD E1,X'2000',X'01';
CPYBLA MSGID,'CPF9899';
CPYNV DTALEN,1;
CALLX SEPT(899),MSGLST,*;
B .END;
SPACE;
/* Send a message indicating Job Description changed */
.OK: MODEXCPD E1,X'2000',X'01';
CPYBLA MSGID,'CPC1612';
CPYNV DTALEN,20;
CPYBLA V1(1:10),JOBD;
CPYBLA V1(11:10),LIB;
CPYBLA MSGTYP,'COMP';
CALLX SEPT(899),MSGLST,*;
BRK 'END';
SPACE;
/* End of the program */
.END: DEACTPG *;
RTX *;
EJECT;
/* */
/* Move a string from ST to CMD until first blank or number of */
/* characters = LN */
/* */
BRK 'MOVDCL';
DCL SPCPTR P.ST PARM;
DCL SPCPTR P.LN PARM;
DCL OL MOVLST(P.ST,P.LN) PARM;
DCL DD ST CHAR(512) BAS(P.ST);
DCL DD LN BIN(4) BAS(P.LN);
SPACE 3;
ENTRY MOVSTR(MOVLST);
BRK 'MOVE';
CPYNV I,1;
.LP: CMPBLA(B) ST(I:1),' '/EQ(.ENDLP);
CPYBLA CMD(J:1),ST(I:1);
CPYBLA *IN01,'0';
ADDN(S) J,1;
.REP: ADDN(S) I,1;
CMPNV(B) I,LN/NHI(.LP);
.RTN: CPYBLA *IN01,'0';
B RTNPTR;
.ENDLP: CMPBLA(B) *IN01,'1'/EQ(.REP);
B RTNPTR;
EJECT;
/* */
/* Move a string from ST to CMD suppressing blanks at the end of */
/* the line */
/* */
BRK 'TRCDCL';
DCL SPCPTR P.ST1 PARM;
DCL SPCPTR P.LN1 PARM;
DCL OL TRCLST(P.ST1,P.LN1) PARM;
DCL DD ST1 CHAR(512) BAS(P.ST1);
DCL DD LN1 BIN(4) BAS(P.LN1);
SPACE 3;
ENTRY TRCSTR(TRCLST);
BRK 'TRNC';
CPYNV I,LN1;
.LP1: CMPBLA(B) ST1(I:1),' '/NEQ(.MOVE);
SUBN(S) I,1;
CMPNV(B) I,1/HI(.LP1);
.MOVE: CPYBLA CMD(J:I),ST1(1:I);
ADDN(S) J,I;
B RTNPTR;
PEND;